<?php
namespace app\admin\controller\sys;

use app\BaseController;
use app\common\business\sys\CommonSysOtherConfig as serviceModel;

class CommonSysOtherConfig extends BaseController
{

    public function initialize()
    {
    }

    /*
     * 所有数组
     */
    public function load(){
        $data = [
            'model' => serviceModel::getOne(['id'=>1])
        ];
        jsonSuccess($data);
    }

    /*
     * 修改和编辑
     */
    public function edit(){
        $fildes = "id,service_mobile,present_percent,code_minute,start_ip_status";
        $receiveData = getData($this->request->post(),$fildes);
        if(!empty($receiveData['id'])){
            serviceModel::edit($receiveData);
        }else{
            serviceModel::insert($receiveData);
        }
        jsonSuccess();
    }

}
